<template>
  <el-card class="box-card">
    <el-form-item>
        <template>
          <span>驳回原因:</span>
          <el-input type="textarea"  :rows="10" v-model="rejectReason"></el-input>
        </template>
        <span slot="footer" class="dialog-footer">
      </span>
      <el-button type="primary" style="font-size: 17px; float: right; padding: 3px 0;margin-right: 980px" @click="saveRejectReason">确定</el-button>
    </el-form-item>
  </el-card>
</template>

<script>
  import {m, notify} from "@/store/yg/common/local";
  import {ajax} from "@/store/yg/common/utils";
  import axios from "axios";
  import * as constant from "@/store/yg/common/constant";
  import ShowPayments from "../../../main/finance/payapply/showPayments";

  export default {
    data() {
      return {
        dialogVisible: false,
        changeOrderNo:"",
        changeOrderContent:"",
        rejectReason:"",
        changeOrderDate:"",
        changeOrderUser:"",
        waybillNo:"",
        inStockChannel:"",
        userOption:[],
        id:"",
        ids:[],
      };
    },

    mounted() {
      this.initData();
    },
    methods: {
      handleClose(done) {
        this.$confirm('确认关闭？')
          .then(_ => {
            done();
          })
          .catch(_ => {});

      },
   initData(){
     console.log(this.$store.state)
     this.rejectReason=this.$store.state.edit.row["rejectReason"];
     this.id=this.$store.state.edit.row["id"];
   },
      async  saveRejectReason(){
        this.ids.push(this.id);
        if (this.$store.state.edit["ids"]!=null){
          if (this.$store.state.edit["ids"].length>0){
            this.ids=this.$store.state.edit["ids"];
          }
        }
        console.log(this.ids)
        let req = {};
        req.rejectReason=this.rejectReason;
        req.ids =   this.ids;
        const { code, data, message } = await ajax(
          "saveRejectReason",
          req
        );
          this.$message({
            type: "success",
            message: "成功驳回"
          });
      },
    }
  };
</script>

<style scoped>
  .text {
    font-size: 15px;
  }

  .item {
    margin-bottom: 30px;
  }

  .clearfix:before,
  .clearfix:after {
    display: table;
    content: "";
  }
  .clearfix:after {
    clear: both
  }

  .box-card {
    width: 1135px;
  }
</style>
